using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using LB.Entitity;


namespace LB.Business.Article.Entities
{
	/// <summary>
	/// 新闻表
	/// </summary>
	[Serializable]
	[DataContract]
	public partial class Article: BusinesBase, IEquatable<Article>
	{

		#region Private Members

		private string _fguid; 
		private string _categoryid; 
		private string _channel; 
		private string _title; 
		private string _author; 
		private string _source; 
		private string _contents; 
		private string _introduction; 
		private string _status; 
		private int? _click; 
		private string _addid; 
		private DateTime? _adddate; 
		private string _createid; 
		private DateTime? _createdate; 		
		#endregion

		#region Constructor

		public Article()
		{
			_fguid = String.Empty; 
			_categoryid = String.Empty; 
			_channel = String.Empty; 
			_title = String.Empty; 
			_author = String.Empty; 
			_source = String.Empty; 
			_contents = String.Empty; 
			_introduction = String.Empty; 
			_status = String.Empty; 
			_click = new int?(); 
			_addid = String.Empty; 
			_adddate = new DateTime?(); 
			_createid = String.Empty; 
			_createdate = new DateTime?(); 
		}
		#endregion // End of Default ( Empty ) Class Constuctor

		#region Required Fields Only Constructor
		/// <summary>
		/// required (not null) fields only constructor
		/// </summary>
        public Article(
			string fguid)
			: this()
		{
			_fguid = fguid;
			_categoryid = String.Empty;
			_channel = String.Empty;
			_title = String.Empty;
			_author = String.Empty;
			_source = String.Empty;
			_contents = String.Empty;
			_introduction = String.Empty;
			_status = String.Empty;
			_click = null;
			_addid = String.Empty;
			_adddate = null;
			_createid = String.Empty;
			_createdate = null;
		}
		#endregion // End Constructor

		#region Public Properties
			
		/// <summary>
		/// 主键
		/// </summary>
		[DataMember]
		public virtual string Fguid
		{
			get
			{ 
				return _fguid;
			}

			set	
			{	
				if( value == null )
					throw new ArgumentOutOfRangeException("Null value not allowed for Fguid", value, "null");
				
				if(  value.Length > 36)
					throw new ArgumentOutOfRangeException("Invalid value for Fguid", value, value.ToString());
				
				_fguid = value;
			}
		}
			
		/// <summary>
		/// 所属类别
		/// </summary>
		[DataMember]
		public virtual string Categoryid
		{
			get
			{ 
				return _categoryid;
			}

			set	
			{	
				if(  value != null &&  value.Length > 36)
					throw new ArgumentOutOfRangeException("Invalid value for Categoryid", value, value.ToString());
				
				_categoryid = value;
			}
		}
			
		/// <summary>
		/// 推荐类型
		/// </summary>
		[DataMember]
		public virtual string Channel
		{
			get
			{ 
				return _channel;
			}

			set	
			{	
				if(  value != null &&  value.Length > 2)
					throw new ArgumentOutOfRangeException("Invalid value for Channel", value, value.ToString());
				
				_channel = value;
			}
		}
			
		/// <summary>
		/// 标题
		/// </summary>
		[DataMember]
		public virtual string Title
		{
			get
			{ 
				return _title;
			}

			set	
			{	
				if(  value != null &&  value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for Title", value, value.ToString());
				
				_title = value;
			}
		}
			
		/// <summary>
		/// 作者
		/// </summary>
		[DataMember]
		public virtual string Author
		{
			get
			{ 
				return _author;
			}

			set	
			{	
				if(  value != null &&  value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for Author", value, value.ToString());
				
				_author = value;
			}
		}
			
		/// <summary>
		/// 来源
		/// </summary>
		[DataMember]
		public virtual string Source
		{
			get
			{ 
				return _source;
			}

			set	
			{	
				if(  value != null &&  value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for Source", value, value.ToString());
				
				_source = value;
			}
		}
			
		/// <summary>
		/// 内容
		/// </summary>
		[DataMember]
		public virtual string Contents
		{
			get
			{ 
				return _contents;
			}

			set	
			{	
				if(  value != null &&  value.Length > 2147483647)
					throw new ArgumentOutOfRangeException("Invalid value for Contents", value, value.ToString());
				
				_contents = value;
			}
		}
			
		/// <summary>
		/// 内容简介
		/// </summary>
		[DataMember]
		public virtual string Introduction
		{
			get
			{ 
				return _introduction;
			}

			set	
			{	
				if(  value != null &&  value.Length > 500)
					throw new ArgumentOutOfRangeException("Invalid value for Introduction", value, value.ToString());
				
				_introduction = value;
			}
		}
			
		/// <summary>
		/// 状态
		/// </summary>
		[DataMember]
		public virtual string Status
		{
			get
			{ 
				return _status;
			}

			set	
			{	
				if(  value != null &&  value.Length > 10)
					throw new ArgumentOutOfRangeException("Invalid value for Status", value, value.ToString());
				
				_status = value;
			}
		}
			
		/// <summary>
		/// 点击数
		/// </summary>
		[DataMember]
		public virtual int? Click
		{
			get
			{ 
				return _click;
			}
			set
			{
				_click = value;
			}

		}
			
		/// <summary>
		/// 添加人
		/// </summary>
		[DataMember]
		public virtual string Addid
		{
			get
			{ 
				return _addid;
			}

			set	
			{	
				if(  value != null &&  value.Length > 36)
					throw new ArgumentOutOfRangeException("Invalid value for Addid", value, value.ToString());
				
				_addid = value;
			}
		}
			
		/// <summary>
		/// 添加日期
		/// </summary>
		[DataMember]
		public virtual DateTime? Adddate
		{
			get
			{ 
				return _adddate;
			}
			set
			{
				_adddate = value;
			}

		}
			
		/// <summary>
		/// 创建人
		/// </summary>
		[DataMember]
		public virtual string Createid
		{
			get
			{ 
				return _createid;
			}

			set	
			{	
				if(  value != null &&  value.Length > 36)
					throw new ArgumentOutOfRangeException("Invalid value for Createid", value, value.ToString());
				
				_createid = value;
			}
		}
			
		/// <summary>
		/// 创建日期
		/// </summary>
		[DataMember]
		public virtual DateTime? Createdate
		{
			get
			{ 
				return _createdate;
			}
			set
			{
				_createdate = value;
			}

		}
			
				
		#endregion 

		#region Public Functions

		#endregion //Public Functions

		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
            Article castObj = (Article)obj; 
			return ( castObj != null ) &&
				( this._fguid == castObj.Fguid );
		}
		
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			
			int hash = 57; 
			hash = 27 ^ hash ^ _fguid.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region IEquatable members

        public virtual bool Equals(Article other)
		{
			if (other == this)
				return true;
		
			return ( other != null ) &&
				( this._fguid == other.Fguid );
				   
		}

		#endregion
		
	}
}
